package IU_Admin;

import clases.*;
import java.awt.Dimension;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

public class JF_Inicio_Sistema extends javax.swing.JFrame {

    private Sistema sistema;
    private CamaraInicio[] ci = new CamaraInicio[4];
    private CamaraFin[] cf = new CamaraFin[4];
    private JTextField[] jt_matricula = new JTextField[4];
    private JTextField[] jt_tamaño = new JTextField[4];
    private JButton[] jb_detectar = new JButton[4];
    private JButton[] jb_guardar = new JButton[4];   
    private JTextField[] jt_matricula_fin = new JTextField[4];
    private Timer tim = new Timer();
    private final int AUTOGUARDADO = 300000;    //5 minutos
    
    //Esta tarea se encargara de guardar todos los datos en un fichero cada tiempo establecido
    private TimerTask autoguardar = new TimerTask(){
        public void run() {
            jlt_info.setText("Guardando...");
            try {
                jlt_info.setText(sistema.GuardarDatos());   
            } catch (FileNotFoundException ex) {
                jlt_info.setText("El fichero no fue encontrado. Codigo de error: "+ex);
            } catch (IOException ex) {
                jlt_info.setText("Error en la E/S. Codigo de error: "+ex);
            }
        }
    };
 
    public JF_Inicio_Sistema() throws FileNotFoundException, IOException {
        initComponents();
        sistema = new Sistema();
        //Creamos un objeto de tipo Timer, el cual ejecutara una tarea (1er argumento)
        //El cual se ejecutara trancurrido el tiempo indicado (2º argumento)
        //Y se repetira cada tiempo indicado(3er argumento)
        //Además utilizamos scheduleAtFixedRate para no incrementar los tiempos
        //Aunque puede ser mas pesado para el procesador implica menos riesgos a la hora de ejecutrar una tarea vital.
        tim.scheduleAtFixedRate(autoguardar, AUTOGUARDADO, AUTOGUARDADO);     
        lb_iniciado.setText("Sin inicar");
        jb_Radar.setEnabled(false);
        jb_camaraFin.setEnabled(false);
        jb_camaraInicio.setEnabled(false);
        jb_agregarRadar.setEnabled(false);
        jMenuItem4.setEnabled(false);
        JP_Inicio.setVisible(true);
        JP_Camaras_Inicio.setVisible(false);
        JP_Camara_Fin.setVisible(false);
        JP_Radares.setVisible(false);
        JP_Listado.setVisible(false);
        
        //Agrupacion de los radio button
        buttonGroup1.add(jrb_ticket);
        buttonGroup1.add(jrb_multas);
        buttonGroup2.add(jrb_fecha);
        buttonGroup2.add(jrb_matricula);
        
        dateChooserCombo1.setDateFormat(new SimpleDateFormat("dd/MM/yyyy"));
        dateChooserCombo2.setDateFormat(new SimpleDateFormat("dd/MM/yyyy"));       
        
        //Los meses para Calendar empiezan en 00, por tanto no es necesario restarle el mes
        //Si fuera necesario se emeplearia calendar.add(Calendar.MONTH, -1)
        Calendar calendar = Calendar.getInstance();
        int año = calendar.get(Calendar.YEAR);
        int mes = calendar.get(Calendar.MONTH);
        int dia = calendar.get(Calendar.DATE);
        dateChooserCombo1.setText(dia+"/"+mes+"/"+año);
        
        jrb_ticket.setSelected(true);
        jrb_fecha.setSelected(true);   
        
        this.setSize(new Dimension(260, 450));
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        dateChooserDialog1 = new datechooser.beans.DateChooserDialog();
        JP_Inicio = new javax.swing.JPanel();
        lb_iniciado = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jb_agregarRadar = new javax.swing.JButton();
        jb_agregarRadar2 = new javax.swing.JButton();
        jb_iniciar = new javax.swing.JButton();
        jb_Radar = new javax.swing.JButton();
        jb_camaraInicio = new javax.swing.JButton();
        jb_camaraFin = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jlt_info = new javax.swing.JLabel();
        JP_Camaras_Inicio = new javax.swing.JPanel();
        jTabbedPane3 = new javax.swing.JTabbedPane();
        JP_Camara = new javax.swing.JPanel();
        jPanel9 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        JT_Matricula_1 = new javax.swing.JTextField();
        JB_Detectar_1 = new javax.swing.JButton();
        jLabel10 = new javax.swing.JLabel();
        JT_Tamaño_1 = new javax.swing.JTextField();
        JB_Guardar_1 = new javax.swing.JButton();
        JP_Camara1 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        JT_Matricula_2 = new javax.swing.JTextField();
        JB_Detectar_2 = new javax.swing.JButton();
        jLabel12 = new javax.swing.JLabel();
        JT_Tamaño_2 = new javax.swing.JTextField();
        JB_Guardar_2 = new javax.swing.JButton();
        JP_Camara2 = new javax.swing.JPanel();
        jPanel11 = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        JT_Matricula_3 = new javax.swing.JTextField();
        JB_Detectar_3 = new javax.swing.JButton();
        jLabel14 = new javax.swing.JLabel();
        JT_Tamaño_3 = new javax.swing.JTextField();
        JB_Guardar_3 = new javax.swing.JButton();
        JP_Camara3 = new javax.swing.JPanel();
        jPanel12 = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        JT_Matricula_4 = new javax.swing.JTextField();
        JB_Detectar_4 = new javax.swing.JButton();
        jLabel16 = new javax.swing.JLabel();
        JT_Tamaño_4 = new javax.swing.JTextField();
        JB_Guardar_4 = new javax.swing.JButton();
        JL_Info = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        JP_Camara_Fin = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();
        jPanel16 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        JTF_Matricula_Fin_1 = new javax.swing.JTextField();
        JB_Guardar_Fin_1 = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jPanel15 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        JTF_Matricula_Fin_2 = new javax.swing.JTextField();
        JB_Guardar_Fin_2 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jPanel14 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        JTF_Matricula_Fin_3 = new javax.swing.JTextField();
        JB_Guardar_Fin_3 = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jPanel13 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        JTF_Matricula_Fin_4 = new javax.swing.JTextField();
        JB_Guardar_Fin_4 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        JP_Radares = new javax.swing.JPanel();
        jtp_radares = new javax.swing.JTabbedPane();
        jButton5 = new javax.swing.JButton();
        JP_Listado = new javax.swing.JPanel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel6 = new javax.swing.JLabel();
        jrb_ticket = new javax.swing.JRadioButton();
        jrb_multas = new javax.swing.JRadioButton();
        jLabel7 = new javax.swing.JLabel();
        dateChooserCombo1 = new datechooser.beans.DateChooserCombo();
        jLabel8 = new javax.swing.JLabel();
        dateChooserCombo2 = new datechooser.beans.DateChooserCombo();
        jButton1 = new javax.swing.JButton();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jtf_matricula_lista = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        jrb_fecha = new javax.swing.JRadioButton();
        jrb_matricula = new javax.swing.JRadioButton();
        jButton4 = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        jButton6 = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Peajes 2013");
        setAlwaysOnTop(true);
        setMaximumSize(new java.awt.Dimension(415, 388));
        setPreferredSize(new java.awt.Dimension(415, 550));
        setResizable(false);

        lb_iniciado.setText("Iniciado");

        jLabel1.setText("Estado del Sistema:");

        jb_agregarRadar.setText("Agregar Radares");
        jb_agregarRadar.setToolTipText("Agregar Radares");
        jb_agregarRadar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_agregarRadarActionPerformed(evt);
            }
        });

        jb_agregarRadar2.setText("Gestionar Listados");
        jb_agregarRadar2.setToolTipText("Gestionar Listados");
        jb_agregarRadar2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_agregarRadar2ActionPerformed(evt);
            }
        });

        jb_iniciar.setText("Iniciar Sistema");
        jb_iniciar.setToolTipText("Iniciar Sistema");
        jb_iniciar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_iniciarActionPerformed(evt);
            }
        });

        jb_Radar.setText("Gestionar Radares");
        jb_Radar.setToolTipText("Gestionar Radares");
        jb_Radar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_RadarActionPerformed(evt);
            }
        });

        jb_camaraInicio.setText("Gestionar Camaras Inicio");
        jb_camaraInicio.setToolTipText("Gestionar Camaras Inicio");
        jb_camaraInicio.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jb_camaraInicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_camaraInicioActionPerformed(evt);
            }
        });

        jb_camaraFin.setText("Gestionar Camaras Fin");
        jb_camaraFin.setToolTipText("Gestionar Camaras Fin");
        jb_camaraFin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_camaraFinActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout JP_InicioLayout = new javax.swing.GroupLayout(JP_Inicio);
        JP_Inicio.setLayout(JP_InicioLayout);
        JP_InicioLayout.setHorizontalGroup(
            JP_InicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_InicioLayout.createSequentialGroup()
                .addGroup(JP_InicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JP_InicioLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(lb_iniciado))
                    .addGroup(JP_InicioLayout.createSequentialGroup()
                        .addGap(39, 39, 39)
                        .addGroup(JP_InicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jb_agregarRadar2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jb_agregarRadar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jb_camaraFin, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jb_Radar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jb_camaraInicio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jb_iniciar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addGap(28, 28, 28))
        );
        JP_InicioLayout.setVerticalGroup(
            JP_InicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_InicioLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(JP_InicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(lb_iniciado))
                .addGap(45, 45, 45)
                .addComponent(jb_iniciar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jb_agregarRadar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jb_camaraInicio)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jb_camaraFin)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jb_Radar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jb_agregarRadar2)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jlt_info)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGap(0, 21, Short.MAX_VALUE)
                .addComponent(jlt_info))
        );

        jPanel9.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 163, Short.MAX_VALUE)
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 194, Short.MAX_VALUE)
        );

        jLabel9.setText("Matricula:");

        JT_Matricula_1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JT_Matricula_1ActionPerformed(evt);
            }
        });

        JB_Detectar_1.setText("Detectar");
        JB_Detectar_1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_Detectar_1ActionPerformed(evt);
            }
        });

        jLabel10.setText("Tamaño");

        JB_Guardar_1.setText("Guardar");
        JB_Guardar_1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_Guardar_1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout JP_CamaraLayout = new javax.swing.GroupLayout(JP_Camara);
        JP_Camara.setLayout(JP_CamaraLayout);
        JP_CamaraLayout.setHorizontalGroup(
            JP_CamaraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_CamaraLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JP_CamaraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel9)
                    .addComponent(jLabel10)
                    .addComponent(JT_Tamaño_1)
                    .addComponent(JT_Matricula_1)
                    .addComponent(JB_Detectar_1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(JB_Guardar_1, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(24, Short.MAX_VALUE))
        );
        JP_CamaraLayout.setVerticalGroup(
            JP_CamaraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_CamaraLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(JP_CamaraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JP_CamaraLayout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JT_Matricula_1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JB_Detectar_1)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JT_Tamaño_1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JB_Guardar_1))
                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(17, Short.MAX_VALUE))
        );

        jTabbedPane3.addTab("Camara 1", JP_Camara);

        jPanel10.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 163, Short.MAX_VALUE)
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 194, Short.MAX_VALUE)
        );

        jLabel11.setText("Matricula:");

        JT_Matricula_2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JT_Matricula_2ActionPerformed(evt);
            }
        });

        JB_Detectar_2.setText("Detectar");
        JB_Detectar_2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_Detectar_2ActionPerformed(evt);
            }
        });

        jLabel12.setText("Tamaño");

        JB_Guardar_2.setText("Guardar");
        JB_Guardar_2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_Guardar_2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout JP_Camara1Layout = new javax.swing.GroupLayout(JP_Camara1);
        JP_Camara1.setLayout(JP_Camara1Layout);
        JP_Camara1Layout.setHorizontalGroup(
            JP_Camara1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_Camara1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JP_Camara1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel11)
                    .addComponent(jLabel12)
                    .addComponent(JT_Tamaño_2)
                    .addComponent(JT_Matricula_2)
                    .addComponent(JB_Detectar_2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(JB_Guardar_2, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(24, Short.MAX_VALUE))
        );
        JP_Camara1Layout.setVerticalGroup(
            JP_Camara1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_Camara1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(JP_Camara1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JP_Camara1Layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JT_Matricula_2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JB_Detectar_2)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JT_Tamaño_2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JB_Guardar_2))
                    .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(17, Short.MAX_VALUE))
        );

        jTabbedPane3.addTab("Camara 2", JP_Camara1);

        jPanel11.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 163, Short.MAX_VALUE)
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 194, Short.MAX_VALUE)
        );

        jLabel13.setText("Matricula:");

        JT_Matricula_3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JT_Matricula_3ActionPerformed(evt);
            }
        });

        JB_Detectar_3.setText("Detectar");
        JB_Detectar_3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_Detectar_3ActionPerformed(evt);
            }
        });

        jLabel14.setText("Tamaño");

        JB_Guardar_3.setText("Guardar");
        JB_Guardar_3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_Guardar_3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout JP_Camara2Layout = new javax.swing.GroupLayout(JP_Camara2);
        JP_Camara2.setLayout(JP_Camara2Layout);
        JP_Camara2Layout.setHorizontalGroup(
            JP_Camara2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_Camara2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JP_Camara2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel13)
                    .addComponent(jLabel14)
                    .addComponent(JT_Tamaño_3)
                    .addComponent(JT_Matricula_3)
                    .addComponent(JB_Detectar_3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(JB_Guardar_3, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(24, Short.MAX_VALUE))
        );
        JP_Camara2Layout.setVerticalGroup(
            JP_Camara2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_Camara2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(JP_Camara2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JP_Camara2Layout.createSequentialGroup()
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JT_Matricula_3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JB_Detectar_3)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JT_Tamaño_3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JB_Guardar_3))
                    .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(17, Short.MAX_VALUE))
        );

        jTabbedPane3.addTab("Camara 3", JP_Camara2);

        jPanel12.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 163, Short.MAX_VALUE)
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 194, Short.MAX_VALUE)
        );

        jLabel15.setText("Matricula:");

        JT_Matricula_4.setToolTipText("Matricula");
        JT_Matricula_4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JT_Matricula_4ActionPerformed(evt);
            }
        });

        JB_Detectar_4.setText("Detectar");
        JB_Detectar_4.setToolTipText("Detectar");
        JB_Detectar_4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_Detectar_4ActionPerformed(evt);
            }
        });

        jLabel16.setText("Tamaño");

        JB_Guardar_4.setText("Guardar");
        JB_Guardar_4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_Guardar_4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout JP_Camara3Layout = new javax.swing.GroupLayout(JP_Camara3);
        JP_Camara3.setLayout(JP_Camara3Layout);
        JP_Camara3Layout.setHorizontalGroup(
            JP_Camara3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_Camara3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JP_Camara3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel15)
                    .addComponent(jLabel16)
                    .addComponent(JT_Tamaño_4)
                    .addComponent(JT_Matricula_4)
                    .addComponent(JB_Detectar_4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(JB_Guardar_4, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(24, Short.MAX_VALUE))
        );
        JP_Camara3Layout.setVerticalGroup(
            JP_Camara3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_Camara3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(JP_Camara3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JP_Camara3Layout.createSequentialGroup()
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JT_Matricula_4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JB_Detectar_4)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel16)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JT_Tamaño_4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JB_Guardar_4))
                    .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(17, Short.MAX_VALUE))
        );

        jTabbedPane3.addTab("Camara 4", JP_Camara3);

        JL_Info.setText(".");

        jButton2.setText("Volver");
        jButton2.setToolTipText("Volver");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout JP_Camaras_InicioLayout = new javax.swing.GroupLayout(JP_Camaras_Inicio);
        JP_Camaras_Inicio.setLayout(JP_Camaras_InicioLayout);
        JP_Camaras_InicioLayout.setHorizontalGroup(
            JP_Camaras_InicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane3)
            .addGroup(JP_Camaras_InicioLayout.createSequentialGroup()
                .addGap(141, 141, 141)
                .addComponent(jButton2)
                .addContainerGap())
            .addGroup(JP_Camaras_InicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(JP_Camaras_InicioLayout.createSequentialGroup()
                    .addGap(125, 125, 125)
                    .addComponent(JL_Info, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(126, Short.MAX_VALUE)))
        );
        JP_Camaras_InicioLayout.setVerticalGroup(
            JP_Camaras_InicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_Camaras_InicioLayout.createSequentialGroup()
                .addComponent(jTabbedPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton2)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(JP_Camaras_InicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(JP_Camaras_InicioLayout.createSequentialGroup()
                    .addGap(140, 140, 140)
                    .addComponent(JL_Info)
                    .addContainerGap(141, Short.MAX_VALUE)))
        );

        jPanel16.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 163, Short.MAX_VALUE)
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 194, Short.MAX_VALUE)
        );

        jLabel5.setText("Matrícula:");

        JB_Guardar_Fin_1.setText("Guardar");
        JB_Guardar_Fin_1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_Guardar_Fin_1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JTF_Matricula_Fin_1)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(JB_Guardar_Fin_1, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(JTF_Matricula_Fin_1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(JB_Guardar_Fin_1))
                    .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(17, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Camara 1", jPanel3);

        jPanel15.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 163, Short.MAX_VALUE)
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 194, Short.MAX_VALUE)
        );

        jLabel4.setText("Matrícula:");

        JB_Guardar_Fin_2.setText("Guardar");
        JB_Guardar_Fin_2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_Guardar_Fin_2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JTF_Matricula_Fin_2)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(JB_Guardar_Fin_2, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(JTF_Matricula_Fin_2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(JB_Guardar_Fin_2))
                    .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(17, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Camara 2", jPanel4);

        jPanel14.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 163, Short.MAX_VALUE)
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 194, Short.MAX_VALUE)
        );

        jLabel3.setText("Matrícula:");

        JB_Guardar_Fin_3.setText("Guardar");
        JB_Guardar_Fin_3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_Guardar_Fin_3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JTF_Matricula_Fin_3)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(JB_Guardar_Fin_3, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(JTF_Matricula_Fin_3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(JB_Guardar_Fin_3))
                    .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(17, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Camara 3", jPanel5);

        jPanel13.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 163, Short.MAX_VALUE)
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 194, Short.MAX_VALUE)
        );

        jLabel2.setText("Matrícula:");

        JB_Guardar_Fin_4.setText("Guardar");
        JB_Guardar_Fin_4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_Guardar_Fin_4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JTF_Matricula_Fin_4)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(JB_Guardar_Fin_4, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(JTF_Matricula_Fin_4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(JB_Guardar_Fin_4))
                    .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(17, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Camara 4", jPanel6);

        jButton3.setText("Volver");
        jButton3.setToolTipText("Volver");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout JP_Camara_FinLayout = new javax.swing.GroupLayout(JP_Camara_Fin);
        JP_Camara_Fin.setLayout(JP_Camara_FinLayout);
        JP_Camara_FinLayout.setHorizontalGroup(
            JP_Camara_FinLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, JP_Camara_FinLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton3)
                .addGap(146, 146, 146))
        );
        JP_Camara_FinLayout.setVerticalGroup(
            JP_Camara_FinLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_Camara_FinLayout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 254, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton3)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jButton5.setText("Volver");
        jButton5.setToolTipText("Volver");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout JP_RadaresLayout = new javax.swing.GroupLayout(JP_Radares);
        JP_Radares.setLayout(JP_RadaresLayout);
        JP_RadaresLayout.setHorizontalGroup(
            JP_RadaresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_RadaresLayout.createSequentialGroup()
                .addGap(146, 146, 146)
                .addComponent(jButton5)
                .addContainerGap(166, Short.MAX_VALUE))
            .addComponent(jtp_radares)
        );
        JP_RadaresLayout.setVerticalGroup(
            JP_RadaresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_RadaresLayout.createSequentialGroup()
                .addComponent(jtp_radares, javax.swing.GroupLayout.PREFERRED_SIZE, 255, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton5)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jLabel6.setText("Generar Listados:");

        jrb_ticket.setText("Tickets del Peaje");
        jrb_ticket.setToolTipText("Tickets del Peaje");

        jrb_multas.setText("Multas");
        jrb_multas.setToolTipText("Multas");

        jLabel7.setText("Desde:");

        dateChooserCombo1.setCurrentView(new datechooser.view.appearance.AppearancesList("Swing",
            new datechooser.view.appearance.ViewAppearance("custom",
                new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                    new java.awt.Color(0, 0, 0),
                    new java.awt.Color(0, 0, 255),
                    false,
                    true,
                    new datechooser.view.appearance.swing.ButtonPainter()),
                new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                    new java.awt.Color(0, 0, 0),
                    new java.awt.Color(0, 0, 255),
                    true,
                    true,
                    new datechooser.view.appearance.swing.ButtonPainter()),
                new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                    new java.awt.Color(0, 0, 255),
                    new java.awt.Color(0, 0, 255),
                    false,
                    true,
                    new datechooser.view.appearance.swing.ButtonPainter()),
                new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                    new java.awt.Color(128, 128, 128),
                    new java.awt.Color(0, 0, 255),
                    false,
                    true,
                    new datechooser.view.appearance.swing.LabelPainter()),
                new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                    new java.awt.Color(0, 0, 0),
                    new java.awt.Color(0, 0, 255),
                    false,
                    true,
                    new datechooser.view.appearance.swing.LabelPainter()),
                new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                    new java.awt.Color(0, 0, 0),
                    new java.awt.Color(255, 0, 0),
                    false,
                    false,
                    new datechooser.view.appearance.swing.ButtonPainter()),
                (datechooser.view.BackRenderer)null,
                false,
                true)));
    dateChooserCombo1.setBehavior(datechooser.model.multiple.MultyModelBehavior.SELECT_SINGLE);

    jLabel8.setText("Hasta:");

    dateChooserCombo2.setBehavior(datechooser.model.multiple.MultyModelBehavior.SELECT_SINGLE);

    jButton1.setText("Generar");
    jButton1.setToolTipText("Generar");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });

    jLabel17.setText("Generar Lista Asociada:");

    jLabel18.setText("Matrícula:");

    jtf_matricula_lista.setToolTipText("Matrícula");

    jLabel19.setText("Ordenar por:");

    jrb_fecha.setText("Fecha");
    jrb_fecha.setToolTipText("Fecha");

    jrb_matricula.setText("Matrícula");
    jrb_matricula.setToolTipText("Matrícula");

    jButton4.setText("Generar");
    jButton4.setToolTipText("Generar");
    jButton4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton4ActionPerformed(evt);
        }
    });

    jButton6.setText("Volver");
    jButton6.setToolTipText("Volver");
    jButton6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton6ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout JP_ListadoLayout = new javax.swing.GroupLayout(JP_Listado);
    JP_Listado.setLayout(JP_ListadoLayout);
    JP_ListadoLayout.setHorizontalGroup(
        JP_ListadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(JP_ListadoLayout.createSequentialGroup()
            .addGroup(JP_ListadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(JP_ListadoLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(JP_ListadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jSeparator1)
                        .addComponent(jSeparator2)))
                .addGroup(JP_ListadoLayout.createSequentialGroup()
                    .addGroup(JP_ListadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(JP_ListadoLayout.createSequentialGroup()
                            .addContainerGap()
                            .addGroup(JP_ListadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel18)
                                .addComponent(jLabel17)
                                .addComponent(jtf_matricula_lista, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel6)
                                .addGroup(JP_ListadoLayout.createSequentialGroup()
                                    .addGap(10, 10, 10)
                                    .addGroup(JP_ListadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(jButton1)
                                        .addGroup(JP_ListadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jrb_multas)
                                            .addComponent(jrb_ticket)
                                            .addComponent(jLabel7)
                                            .addComponent(dateChooserCombo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel8)
                                            .addComponent(dateChooserCombo2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel19)
                                            .addComponent(jrb_fecha)
                                            .addComponent(jrb_matricula))))))
                        .addGroup(JP_ListadoLayout.createSequentialGroup()
                            .addGap(106, 106, 106)
                            .addComponent(jButton4))
                        .addGroup(JP_ListadoLayout.createSequentialGroup()
                            .addGap(111, 111, 111)
                            .addComponent(jButton6)))
                    .addGap(0, 93, Short.MAX_VALUE)))
            .addContainerGap())
    );
    JP_ListadoLayout.setVerticalGroup(
        JP_ListadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(JP_ListadoLayout.createSequentialGroup()
            .addContainerGap()
            .addComponent(jLabel6)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jrb_ticket)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jrb_multas)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jLabel7)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(dateChooserCombo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jLabel8)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(dateChooserCombo2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jLabel19)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jrb_fecha)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jrb_matricula)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jButton1)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jLabel17)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jLabel18)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jtf_matricula_lista, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jButton4)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jButton6)
            .addContainerGap())
    );

    jMenu1.setMnemonic('M');
    jMenu1.setText("Menu");
    jMenu1.setToolTipText("Menu");

    jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/imgres.jpg"))); // NOI18N
    jMenuItem4.setMnemonic('G');
    jMenuItem4.setText("Guardar");
    jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem4ActionPerformed(evt);
        }
    });
    jMenu1.add(jMenuItem4);

    jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/salir.jpg"))); // NOI18N
    jMenuItem3.setMnemonic('S');
    jMenuItem3.setText("Salir");
    jMenuItem3.setToolTipText("Salir");
    jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem3ActionPerformed(evt);
        }
    });
    jMenu1.add(jMenuItem3);

    jMenuBar1.add(jMenu1);

    jMenu2.setText("Ayuda");

    jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/ayuda.jpg"))); // NOI18N
    jMenuItem1.setText("Ayuda");
    jMenu2.add(jMenuItem1);

    jMenuItem2.setText("Acerca de");
    jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem2ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem2);

    jMenuBar1.add(jMenu2);

    setJMenuBar(jMenuBar1);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(JP_Inicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(18, 18, 18)
            .addComponent(JP_Camaras_Inicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(JP_Camara_Fin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(JP_Radares, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(JP_Listado, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addContainerGap())
        .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(JP_Camaras_Inicio, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(JP_Inicio, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(JP_Camara_Fin, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(JP_Radares, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(JP_Listado, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGap(29, 29, 29)
            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    );

    pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        jlt_info.setText("Guardando...");
        try {
            sistema.GuardarDatos();
            jlt_info.setText("Datos Guardados...");
        } catch (FileNotFoundException ex) {
            jlt_info.setText("El fichero no fue encontrado. Codigo de error: "+ex);
        } catch (IOException ex) {
            jlt_info.setText("Error al guardar los datos. Error: " + ex);
        }
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        try {
            sistema.GuardarDatos();
        } catch (FileNotFoundException ex) {
            Logger.getLogger(JF_Inicio_Sistema.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(JF_Inicio_Sistema.class.getName()).log(Level.SEVERE, null, ex);
        }
        System.exit(0);
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jb_iniciarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_iniciarActionPerformed
        String seleccion = JOptionPane.showInputDialog(null,"Inserte el número de Radares:",JOptionPane.QUESTION_MESSAGE);
        try{
            int numeroRadares = Integer.parseInt(seleccion);
            if (numeroRadares > 0){
                for(int i=0;i<=numeroRadares-1;i++)
                    sistema.crearRadar();
                jlt_info.setText("Sistema iniciado: 8 Camaras y "+numeroRadares+" Radares");
            }else
                jlt_info.setText("Error en el numero de radares. Sistema iniciado: 8 Camaras y 0 Radares");
            lb_iniciado.setText("Iniciado");
            jb_iniciar.setEnabled(false);
            jb_Radar.setEnabled(true);
            jb_camaraFin.setEnabled(true);
            jb_camaraInicio.setEnabled(true);
            jb_agregarRadar.setEnabled(true);
            jMenuItem4.setEnabled(true);
        }catch(NumberFormatException e){       }
        
        int i = 1;
        for (Radar r : sistema.getListaRadares()){
            JP_Radar jpr = new JP_Radar(r);
            jpr.setName("Camara "+i);
            jtp_radares.add(jpr);
            i++;
        }
            
    }//GEN-LAST:event_jb_iniciarActionPerformed

    private void jb_agregarRadarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_agregarRadarActionPerformed
        String seleccion = JOptionPane.showInputDialog(null,"Inserte el número de Radares:",JOptionPane.QUESTION_MESSAGE);
        try{
            if (seleccion != null){
                int numeroRadares = Integer.parseInt(seleccion);
                int radares = sistema.getListaRadares().size()+1;
                for(int i=0;i<=numeroRadares-1;i++){
                    JP_Radar jpr = new JP_Radar(sistema.crearRadar());
                    jpr.setName("Camara "+radares);
                    jtp_radares.add(jpr);
                    radares++;
                }
                jlt_info.setText("Se han agregado " + numeroRadares + " radar(es) nuevo(s) al sistema");
            }
        }catch(NumberFormatException e){
            JOptionPane.showMessageDialog(null,"Error en el parametro introducido. Codigo: "+e);
        }
    }//GEN-LAST:event_jb_agregarRadarActionPerformed

    private void JB_Detectar_1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_Detectar_1ActionPerformed
        analizarMatricula(1, jt_matricula[0].getText());
    }//GEN-LAST:event_JB_Detectar_1ActionPerformed

    private void JB_Guardar_1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_Guardar_1ActionPerformed
        try{
            detectar(1, jt_matricula[0].getText(), Float.parseFloat(jt_tamaño[0].getText()));
            cambiarCamara(0,true);
        }catch(NumberFormatException e){
            jlt_info.setText("Tamaño del vehiculo no valido");
        }
        
    }//GEN-LAST:event_JB_Guardar_1ActionPerformed

    private void JT_Matricula_1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JT_Matricula_1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_JT_Matricula_1ActionPerformed

    private void JT_Matricula_2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JT_Matricula_2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_JT_Matricula_2ActionPerformed

    private void JB_Detectar_2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_Detectar_2ActionPerformed
        analizarMatricula(2, jt_matricula[1].getText());
    }//GEN-LAST:event_JB_Detectar_2ActionPerformed

    private void JB_Guardar_2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_Guardar_2ActionPerformed
        detectar(2, jt_matricula[1].getText(), Float.parseFloat(jt_tamaño[1].getText()));
        cambiarCamara(1,true);
    }//GEN-LAST:event_JB_Guardar_2ActionPerformed

    private void JT_Matricula_3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JT_Matricula_3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_JT_Matricula_3ActionPerformed

    private void JB_Detectar_3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_Detectar_3ActionPerformed
        analizarMatricula(3, jt_matricula[2].getText());
    }//GEN-LAST:event_JB_Detectar_3ActionPerformed

    private void JB_Guardar_3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_Guardar_3ActionPerformed
        detectar(3, jt_matricula[2].getText(), Float.parseFloat(jt_tamaño[2].getText()));
        cambiarCamara(2,true);
    }//GEN-LAST:event_JB_Guardar_3ActionPerformed

    private void JT_Matricula_4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JT_Matricula_4ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_JT_Matricula_4ActionPerformed

    private void JB_Detectar_4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_Detectar_4ActionPerformed
        analizarMatricula(4, jt_matricula[3].getText());
    }//GEN-LAST:event_JB_Detectar_4ActionPerformed

    private void JB_Guardar_4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_Guardar_4ActionPerformed
        detectar(4, jt_matricula[3].getText(), Float.parseFloat(jt_tamaño[3].getText()));
        cambiarCamara(3,true);
    }//GEN-LAST:event_JB_Guardar_4ActionPerformed

    private void jb_camaraInicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_camaraInicioActionPerformed
        JP_Inicio.setVisible(false);
        JP_Camaras_Inicio.setVisible(true);
        rellenarArrays();
        int i = 0;
        for (CamaraInicio c : sistema.getListaCamarasInicio()){
            cambiarCamara(i,true);
            ci[i] = c;
            i++;
        }
        this.setSize(new Dimension(390, 450));
    }//GEN-LAST:event_jb_camaraInicioActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        JP_Inicio.setVisible(true);
        JP_Camaras_Inicio.setVisible(false);
        this.setSize(new Dimension(260, 450));
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        JP_Inicio.setVisible(true);
        JP_Camara_Fin.setVisible(false);
        this.setSize(new Dimension(260, 450));
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jb_camaraFinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_camaraFinActionPerformed
        JP_Inicio.setVisible(false);
        JP_Camara_Fin.setVisible(true);
        rellenarArrayFin();
        int i = 0;
        for (CamaraFin c : sistema.getListaCamarasFin()){
            cf[i] = c;
            i++;
        }
        this.setSize(new Dimension(390, 450));
    }//GEN-LAST:event_jb_camaraFinActionPerformed

    private void JB_Guardar_Fin_3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_Guardar_Fin_3ActionPerformed
        guardarCocheFin(3);
    }//GEN-LAST:event_JB_Guardar_Fin_3ActionPerformed

    private void JB_Guardar_Fin_1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_Guardar_Fin_1ActionPerformed
        guardarCocheFin(1);
    }//GEN-LAST:event_JB_Guardar_Fin_1ActionPerformed

    private void JB_Guardar_Fin_2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_Guardar_Fin_2ActionPerformed
        guardarCocheFin(2);
    }//GEN-LAST:event_JB_Guardar_Fin_2ActionPerformed

    private void JB_Guardar_Fin_4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_Guardar_Fin_4ActionPerformed
        guardarCocheFin(4);
    }//GEN-LAST:event_JB_Guardar_Fin_4ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        JP_Radares.setVisible(false);
        JP_Inicio.setVisible(true);
        this.setSize(new Dimension(260, 450));
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jb_RadarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_RadarActionPerformed
        JP_Radares.setVisible(true);
        JP_Inicio.setVisible(false);
        this.setSize(new Dimension(390, 450));
    }//GEN-LAST:event_jb_RadarActionPerformed

    private void jb_agregarRadar2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_agregarRadar2ActionPerformed
        JP_Inicio.setVisible(false);
        JP_Listado.setVisible(true);
        this.setSize(new Dimension(300, 570));
    }//GEN-LAST:event_jb_agregarRadar2ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        JP_Inicio.setVisible(true);
        JP_Listado.setVisible(false);
        this.setSize(new Dimension(260, 450));
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        this.setAlwaysOnTop(false);
        ArrayList lista = new ArrayList();
        if (jrb_ticket.isSelected())
            if(jrb_fecha.isSelected())
                lista = sistema.filtradoTicketPeaje(dateChooserCombo1.getText(),dateChooserCombo2.getText(),1);
            else if(jrb_matricula.isSelected())
                lista = sistema.filtradoTicketPeaje(dateChooserCombo1.getText(),dateChooserCombo2.getText(),0);
            
        if (jrb_multas.isSelected())
            if(jrb_fecha.isSelected())
                lista = sistema.filtradoMultas(dateChooserCombo1.getText(),dateChooserCombo2.getText(),1);
            else if(jrb_matricula.isSelected())
                lista = sistema.filtradoMultas(dateChooserCombo1.getText(),dateChooserCombo2.getText(),0);
            
        if (!lista.isEmpty())
            new IU_Tabla(lista);
        else
            JOptionPane.showMessageDialog(null,"No hay coincidencias con los requisitos establecidos");
        //this.setAlwaysOnTop(true);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        ArrayList<Multa> lista = new ArrayList();
        lista = sistema.filtradoMultasMatricula(jtf_matricula_lista.getText());
        if (!lista.isEmpty())
            new IU_Tabla(lista);
        else
            JOptionPane.showMessageDialog(null,"No hay coincidencias con los requisitos establecidos");
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        JOptionPane.showMessageDialog(null,"Fecha: 23 de Diciembre de 2012 \n"
                + "Universidad: Rey Juan Carlos \n"
                + "Titutlación: Grado en Ingeniería del Software \n"
                + "Asignatura:  Programación Orientada a Objetos \n"
                + "Autores: Pablo Alonso Jiménez \n"
                + "         Jairo Cerezo Díaz-Cardiel \n"
                + "         Sergio Gonzalez Piedra \n"
                + "Version: 1.0.0","Acerca de...", 3);
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(JF_Inicio_Sistema.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                try {
                    new JF_Inicio_Sistema().setVisible(true);
                } catch (FileNotFoundException ex) {
                    Logger.getLogger(JF_Inicio_Sistema.class.getName()).log(Level.SEVERE, null, ex);
                } catch (IOException ex) {
                    Logger.getLogger(JF_Inicio_Sistema.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
    }
    
    //Funciones camara inicio
    private void rellenarArrays(){
        jt_matricula[0] = JT_Matricula_1;
        jt_matricula[1] = JT_Matricula_2;
        jt_matricula[2] = JT_Matricula_3;
        jt_matricula[3] = JT_Matricula_4;
        jt_tamaño[0] = JT_Tamaño_1;
        jt_tamaño[1] = JT_Tamaño_2;
        jt_tamaño[2] = JT_Tamaño_3;
        jt_tamaño[3] = JT_Tamaño_4;   
        jb_detectar[0] = JB_Detectar_1;
        jb_detectar[1] = JB_Detectar_2;
        jb_detectar[2] = JB_Detectar_3;
        jb_detectar[3] = JB_Detectar_4;
        jb_guardar[0] = JB_Guardar_1;
        jb_guardar[1] = JB_Guardar_2;
        jb_guardar[2] = JB_Guardar_3;
        jb_guardar[3] = JB_Guardar_4;
    }    
    private void analizarMatricula(int camara, String matricula){
        if (ci[camara-1].cocheDetectado(matricula) == false ){
            jlt_info.setText("Coche no encontrado, introduzca el tamaño del vehiculo");
            cambiarCamara(camara-1, false);
        }
        else{
            jlt_info.setText("Coche guardado");
            jt_tamaño[camara-1].setText("");
            cambiarCamara(camara-1, true);
        }
    }
    private void cambiarCamara(int controlador,boolean valor){
        jt_tamaño[controlador].setEditable(!valor);
        jt_matricula[controlador].setEnabled(valor);
        jb_detectar[controlador].setEnabled(valor);
        jb_guardar[controlador].setEnabled(!valor);
        if (valor == true){
            jt_matricula[controlador].setText("");
            jt_tamaño[controlador].setText("");
        }
    }
    private void detectar(int camara, String matricula, float tama){
        Vehiculo v = new Vehiculo(matricula,tama);
        ci[camara-1].detectarCocheNuevo(v);
        jlt_info.setText("Vehiculo guardado con exito");
    }
    
    //Funciones camara fin
    private void rellenarArrayFin(){
        jt_matricula_fin[0] = JTF_Matricula_Fin_1;
        jt_matricula_fin[1] = JTF_Matricula_Fin_2;
        jt_matricula_fin[2] = JTF_Matricula_Fin_3;
        jt_matricula_fin[3] = JTF_Matricula_Fin_4;
    }
    private void guardarCocheFin(int camara){
        if (cf[camara-1].cocheDetectado(jt_matricula_fin[camara-1].getText()) == false ){
            jlt_info.setText("Error del sistema. El vehiculo no ha pasado por una camara anteriormente");
        }
        else{
            cf[camara-1].setTransmitiendo(true);
            jlt_info.setText("Coche guardado");
            jt_matricula_fin[camara-1].setText("");
        }
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton JB_Detectar_1;
    private javax.swing.JButton JB_Detectar_2;
    private javax.swing.JButton JB_Detectar_3;
    private javax.swing.JButton JB_Detectar_4;
    private javax.swing.JButton JB_Guardar_1;
    private javax.swing.JButton JB_Guardar_2;
    private javax.swing.JButton JB_Guardar_3;
    private javax.swing.JButton JB_Guardar_4;
    private javax.swing.JButton JB_Guardar_Fin_1;
    private javax.swing.JButton JB_Guardar_Fin_2;
    private javax.swing.JButton JB_Guardar_Fin_3;
    private javax.swing.JButton JB_Guardar_Fin_4;
    private javax.swing.JLabel JL_Info;
    private javax.swing.JPanel JP_Camara;
    private javax.swing.JPanel JP_Camara1;
    private javax.swing.JPanel JP_Camara2;
    private javax.swing.JPanel JP_Camara3;
    private javax.swing.JPanel JP_Camara_Fin;
    private javax.swing.JPanel JP_Camaras_Inicio;
    private javax.swing.JPanel JP_Inicio;
    private javax.swing.JPanel JP_Listado;
    private javax.swing.JPanel JP_Radares;
    private javax.swing.JTextField JTF_Matricula_Fin_1;
    private javax.swing.JTextField JTF_Matricula_Fin_2;
    private javax.swing.JTextField JTF_Matricula_Fin_3;
    private javax.swing.JTextField JTF_Matricula_Fin_4;
    private javax.swing.JTextField JT_Matricula_1;
    private javax.swing.JTextField JT_Matricula_2;
    private javax.swing.JTextField JT_Matricula_3;
    private javax.swing.JTextField JT_Matricula_4;
    private javax.swing.JTextField JT_Tamaño_1;
    private javax.swing.JTextField JT_Tamaño_2;
    private javax.swing.JTextField JT_Tamaño_3;
    private javax.swing.JTextField JT_Tamaño_4;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private datechooser.beans.DateChooserCombo dateChooserCombo1;
    private datechooser.beans.DateChooserCombo dateChooserCombo2;
    private datechooser.beans.DateChooserDialog dateChooserDialog1;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane3;
    private javax.swing.JButton jb_Radar;
    private javax.swing.JButton jb_agregarRadar;
    private javax.swing.JButton jb_agregarRadar2;
    private javax.swing.JButton jb_camaraFin;
    private javax.swing.JButton jb_camaraInicio;
    private javax.swing.JButton jb_iniciar;
    private javax.swing.JLabel jlt_info;
    private javax.swing.JRadioButton jrb_fecha;
    private javax.swing.JRadioButton jrb_matricula;
    private javax.swing.JRadioButton jrb_multas;
    private javax.swing.JRadioButton jrb_ticket;
    private javax.swing.JTextField jtf_matricula_lista;
    private javax.swing.JTabbedPane jtp_radares;
    private javax.swing.JLabel lb_iniciado;
    // End of variables declaration//GEN-END:variables
}
